// 缓存key前缀
const PREFIX = 'vending_'

export const setCache = (key, value) => {
  localStorage.setItem(PREFIX + key, JSON.stringify(value))
}

export const getCache = (key) => {
  const value = localStorage.getItem(PREFIX + key)
  return value ? JSON.parse(value) : null
}

export const removeCache = (key) => {
  localStorage.removeItem(PREFIX + key)
} 